<?php
$row = $this->request->data;
?>

<div class="row-fluid">
    <div class="span2">
        <div>
            <p class="nav-header">Actions</p>
            <ul class="nav nav-tabs nav-stacked">                
                <li><a href="<?php echo $this->Html->url('index/'); ?>">List Settings</a></li>
            </ul>
        </div>
    </div>
    <div class="span10">
        <form action="<?php echo $this->Html->url('edit/' . $row['Setting']['id']); ?>" class="well" id="SettingEditForm" method="post" accept-charset="utf-8">
            <div style="display:none;">
                <input type="hidden" name="_method" value="PUT">
            </div>        
            <fieldset>
                <legend>Edit Setting</legend>
                <input type="hidden" name="id" help="" value="<?php echo $row['Setting']['id']; ?>" id="UserId">

                <div class="control-group required">
                    <label for="Key">Key</label>
                    <input name="key" help="" readonly="readonly" maxlength="45" type="text" value="<?php echo $row['Setting']['key']; ?>" id="Key" required="required">
                </div>                

                <div class="control-group required">
                    <label for="Value">Value</label>
                    <?php if ($row['Setting']['type'] == 'textarea'): ?>
                        <textarea name="value" help="" type="text" id="Value"><?php echo $row['Setting']['value']; ?></textarea>
                        <script>
                            // Replace the <textarea id="editor1"> with a CKEditor
                            // instance, using default configuration.
                            CKEDITOR.replace('value');
                        </script>
                    <?php else: ?>
                        <input name="value" help="" maxlength="255" type="text" value="<?php echo $row['Setting']['value']; ?>" id="Value" required="required">
                    <?php endif; ?>

                </div>                  

            </fieldset>        
            <div class="submit">
                <input class="btn btn-primary" type="submit" value="Save">
            </div>
        </form>    
    </div>
</div>